package net.valerijtimakov.homefinances.exceptions;

import java.sql.SQLException;

public class AppPersProviderException extends AppPersistentException {

	private static final long serialVersionUID = 1L;
	
	private int errorCode = -1;
	private String sqlState = null;
	
	public AppPersProviderException() {
		super();
	}
	
	public AppPersProviderException(String message) {
		super(message);
	}
	
	public AppPersProviderException(Throwable t) {
		super(t);
	}
	
	public AppPersProviderException(SQLException t) {
		super(t);
		errorCode = t.getErrorCode();
		sqlState = t.getSQLState();
	}
	
	public AppPersProviderException(String message, Throwable t) {
		super(message, t);
	}
	
	public AppPersProviderException(String message, SQLException t) {
		super(message, t);
		errorCode = t.getErrorCode();
		sqlState = t.getSQLState();
	}
	
	public AppPersProviderException(String message, AppPersProviderException t) {
		super(message, t);
		errorCode = t.errorCode;
		sqlState = t.sqlState;
	}
	
	public AppPersProviderException(String message, Throwable t, String userMessage) {
		super(message, t, userMessage);
	}
	
	public AppPersProviderException(String message, SQLException t, String userMessage) {
		super(message, t, userMessage);
		errorCode = t.getErrorCode();
		sqlState = t.getSQLState();
	}

	public int getErrorCode() {
		return errorCode;
	}

	public String getSqlState() {
		return sqlState;
	}

	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}

	public void setSqlState(String sqlState) {
		this.sqlState = sqlState;
	}
	
}
